package com.zd.service.lmpl;/**
 * @Description: ConsigneeServicelmpl
 * @Author:pioneer
 * @Date: 2021-07-05
 * @Version:v1.0
 */

import com.zd.mapper.ConsigneeMapper;
import com.zd.service.lnter.ConsigneeServicelnter;
import com.zzg.entity.Consignee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterBatchUpdateUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: ConsigneeServicelmpl
 * @Author:pioneer
 * @Date: 2021-07-05
 * @Version:v1.0
 */
@Service
public class ConsigneeServicelmpl implements ConsigneeServicelnter {
    @Autowired
    public ConsigneeMapper consigneeMapper;

    /**
     * 查询所有收货人信息
     *
     * @return 收货人集合
     */
    @Override
    public List<Consignee> selectConsignee() {
        return consigneeMapper.selectConsignee ();
    }

    /**
     * 跟据id查询收货人信息
     *
     * @param consigneeid
     * @return
     */
    @Override
    public Consignee getConsigneeByid(String consigneeid) {
        return consigneeMapper.getConsigneeByid (consigneeid);
    }

    /**
     * 根据id修改收货人信息
     *
     * @param consigneeid   收货人id
     * @param consigneename 收货人姓名
     * @param receivingunit 收货单位
     * @return 返回数值判断是否修改成功
     */
    @Override
    public int updateConsignee(String consigneeid, String consigneename, String receivingunit) {
        return consigneeMapper.updateConsignee (consigneeid,consigneename,receivingunit);
    }

    /**
     * 根据id收货人id修改收货人信息
     *
     * @param clientName     收货人姓名
     * @param phone          联系电话
     * @param forwardingUnit 收货单位
     * @param consigneeid    收货人id
     * @return 返回数值判断是否修改成功
     */
    @Override
    public int modifyConsignee(String clientName, String phone, String forwardingUnit, String consigneeid) {
        return consigneeMapper.modifyConsignee (clientName,phone,forwardingUnit,consigneeid);
    }

}
